
package com.innovamed.websocket.service;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import com.innovamed.websocket.utils.redis.RedisUtils;


/**
* 
* Copyright: Copyright (c) 2019 Jun_Zhou
* 
* @ClassName: RabbitMqService.java
* @Description: RabbitMQ相关的业务控制类;
* 
* @version: v1.0.0
* @author: JunZhou
* @Email: 1769676159@qq.com
* @Site: CERNO
* @date: 2019年8月26日 上午10:26:33
*/
@Service
public class RabbitMqService
{
	
	@Autowired
	private AmqpTemplate			rabbitTemplate;
	
	@Autowired
	RedisTemplate<String, Object>	redisTemplate;
	
	@Autowired
	RedisUtils						redisUtils;
	
	/**
	  *   推送消息到指定的队列;
	 * @param msg:消息主体;
	 * @param routeKey:队列和交换机的绑定路由;
	 */
	public void sendMsgToSpecificQueue(String msg, String routeKey)
	{
		String exchangeName = routeKey;
		this.rabbitTemplate.convertAndSend(exchangeName, routeKey, msg);
	}
	
}
